package kis.io.properties;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Read {
	public static String readProperties(String path, String columnName)
	{
		String result = "";
		Properties props = new Properties();
		InputStream in;
		try
		{
			in = new BufferedInputStream(new FileInputStream(path));
			props.load(in);
			result=props.getProperty(columnName);
		} catch (Exception e1)
		{
			e1.printStackTrace();
		}

		return result;
	}

	public static void main(String[] args)
	{
		String path = Read.class.getResource("/").toString().replace("file:", "") + "pos.properties";
		String result = readProperties(path, "OutTime");
		System.out.println(result);
	}
}
